<template>
	<view class="content">
		{{longitude}}-{{latitude}}
	</view>
</template>

<script>
	export default {
		data() {
			return {
				longitude: '',
				latitude: '',
			}
		},
		onLoad: function() {
			this.get_location();
		},
		methods: {
			get_location: function() {
				uni.getLocation({
					type: 'wgs84',
					success: (res) => {
						console.log('当前位置的经度：' + res.longitude);
						console.log('当前位置的纬度：' + res.latitude);
						this.longitude = res.longitude;
						this.latitude = res.latitude;
					}
				});
			}
		}
	}
</script>

<style>

</style>
